package com.hiyee.files.config;

import com.mongodb.MongoClient;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.gridfs.GridFSBucket;
import com.mongodb.client.gridfs.GridFSBuckets;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class GridFsConfig {

    @Value("${spring.data.mongodb.database}")
    private String database;

//    @Bean
//    public GridFSBucket gridFSBucket(MongoClient mongoClient) {
//        System.out.println(database);
//        MongoDatabase mongoDatabase = mongoClient.getDatabase(database);
//        GridFSBucket bucket = GridFSBuckets.create(mongoDatabase);
//        return bucket;
//    }
}
